package modelLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class ModelTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class ModelTest
{
    private modelLayer.PersonContainer personCo1;
    private modelLayer.Person person1;
    private modelLayer.Person person2;
    private modelLayer.Person person3;
    private modelLayer.DVDContainer dvdCo1;
    private modelLayer.DVD dVD1;
    private modelLayer.DVD dVD2;
    private modelLayer.DVD dVD3;
    
    private modelLayer.Copy copy1;
    private modelLayer.Copy copy2;
    private modelLayer.Copy copy3;    
    
    
    
    

    

    
    
    

    /**
     * Default constructor for test class ModelTest
     */
    public ModelTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        
        person1 = new modelLayer.Person("0101141234", "Tyrion Lannister", "Chamber 4", "1234", "Casterly Rock", "521111111");
        person2 = new modelLayer.Person("0202139876", "Ned Stark", "Chamber 8", "9876", "Winterfell", "52333333");
        person3 = new modelLayer.Person("123456789", "TestName", "TestAddress", "TestPostalCode", "TestCity", "TestPhone");
        
        dVD1 = new modelLayer.DVD("00000000", "Batman Begins", "Chris Nolan", "2005", 100.00);
        dVD2 = new modelLayer.DVD("11111111", "The Dark Knight", "Chris Nolan", "2008", 200.00);
        dVD3 = new modelLayer.DVD("22222222", "The Dark Knight Rises", "Chris Nolan", "2012", 150.00);
        
        copy1 = new modelLayer.Copy("123456789","testDate1");
        copy2 = new modelLayer.Copy("987654321","testDate2");
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void AddPersons()
    {
        personCo1.addPerson(person1);
        personCo1.addPerson(person2);
        personCo1.addPerson(person3);
    }

    

    @Test
    public void AddAndGetPerson()
    {
        personCo1.addPerson(person1);
        assertNotNull(personCo1.getPerson("0101141234"));
    }
    
 
    @Test
    public void DeletePersons()
    {
        personCo1.deletePerson(person1);
        personCo1.deletePerson(person2);
        personCo1.deletePerson(person3);
    }

    @Test
    public void AddDVDs()
    {
        dvdCo1.addDVD(dVD1);
        dvdCo1.addDVD(dVD2);
        dvdCo1.addDVD(dVD3);
    }
    
    @Test
    public void DeleteDVDs()
    {
        dvdCo1.deleteDVD(dVD1);
        dvdCo1.deleteDVD(dVD2);
        dvdCo1.deleteDVD(dVD3);
    }
    
    @Test
    public void AddAndGetDVD() 
    {
        dvdCo1.addDVD(dVD1);
        assertNotNull(dvdCo1.getDVD("00000000"));
    }
}




